package main

import (
	"flag"
	"log"

	"gitee.com/ldysdy999/httpprobe/config"
	"gitee.com/ldysdy999/httpprobe/http"
)

var (
	configFile string
)

func main() {
	//传入配置文件路径
	flag.StringVar(&configFile, "c", "probe.yaml", "config file path")

	//解析yaml
	conf, err := config.LoadFile(configFile)
	if err != nil {
		log.Printf("[config.Load.error][error:%v]", err)
		return
	}
	log.Printf("配置是:%v", conf)

	//启动gin
	go http.StartGin(conf)
	//多路复用
	select {}
}
